package mybatis.mapper;

import java.util.List;

import mybatis.domain.User;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface Mapper09 {
	@Select("select user_id id,pw password,name,age,reg_date regDate from users")
	List<User> getUsers();
	
	@Select("select user_id id,pw password,name,age,reg_date regDate from users where user_id=#{id}")
	User getUser(String id);
	
	@Insert("insert into users values(#{id},#{password},#{name},#{age},#{regDate})")
	void addUser(User user);
	
	@Update("update users set name=#{name},age=#{age} where user_id=#{id}")
	void updateUser(User user);
	
	@Delete("delete users where user_id=#{id}")
	void delUser(String id);
}
